<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfAdoptedAlgorithm</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch03.html" title="Libinfinity's adOPTed implementation">
<link rel="prev" href="InfAdoptedSession.html" title="InfAdoptedSession">
<link rel="next" href="InfAdoptedUndoGrouping.html" title="InfAdoptedUndoGrouping">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="InfAdoptedSession.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="InfAdoptedUndoGrouping.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfAdoptedAlgorithm.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#InfAdoptedAlgorithm.description" class="shortcut">Description</a>
                   | 
                  <a href="#InfAdoptedAlgorithm.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#InfAdoptedAlgorithm.properties" class="shortcut">Properties</a>
                   | 
                  <a href="#InfAdoptedAlgorithm.signals" class="shortcut">Signals</a>
</td></tr>
</table>
<div class="refentry" title="InfAdoptedAlgorithm">
<a name="InfAdoptedAlgorithm"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfAdoptedAlgorithm.top_of_page"></a>InfAdoptedAlgorithm</span></h2>
<p>InfAdoptedAlgorithm — adOPTed implementation</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" title="Stability Level">
<a name="InfAdoptedAlgorithm.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfAdoptedAlgorithm.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libinfinity/adopted/inf-adopted-algorithm.h&gt;

                    <a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-struct" title="InfAdoptedAlgorithm">InfAdoptedAlgorithm</a>;
                    <a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithmClass" title="InfAdoptedAlgorithmClass">InfAdoptedAlgorithmClass</a>;
<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="returnvalue">InfAdoptedAlgorithm</span></a> * <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-new" title="inf_adopted_algorithm_new ()">inf_adopted_algorithm_new</a>         (<em class="parameter"><code><a class="link" href="InfUserTable.html" title="InfUserTable"><span class="type">InfUserTable</span></a> *user_table</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>);
<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="returnvalue">InfAdoptedAlgorithm</span></a> * <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-new-full" title="inf_adopted_algorithm_new_full ()">inf_adopted_algorithm_new_full</a>    (<em class="parameter"><code><a class="link" href="InfUserTable.html" title="InfUserTable"><span class="type">InfUserTable</span></a> *user_table</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> max_total_log_size</code></em>);
<a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#InfAdoptedStateVector" title="InfAdoptedStateVector"><span class="returnvalue">InfAdoptedStateVector</span></a> * <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-get-current" title="inf_adopted_algorithm_get_current ()">inf_adopted_algorithm_get_current</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>);
<a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-request-noexec" title="inf_adopted_algorithm_generate_request_noexec ()">inf_adopted_algorithm_generate_request_noexec</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);
<a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-request" title="inf_adopted_algorithm_generate_request ()">inf_adopted_algorithm_generate_request</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);
<a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-undo" title="inf_adopted_algorithm_generate_undo ()">inf_adopted_algorithm_generate_undo</a> (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>);
<a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-redo" title="inf_adopted_algorithm_generate_redo ()">inf_adopted_algorithm_generate_redo</a> (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>);
<a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-translate-request" title="inf_adopted_algorithm_translate_request ()">inf_adopted_algorithm_translate_request</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> *request</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#InfAdoptedStateVector" title="InfAdoptedStateVector"><span class="type">InfAdoptedStateVector</span></a> *to</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-receive-request" title="inf_adopted_algorithm_receive_request ()">inf_adopted_algorithm_receive_request</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> *request</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-can-undo" title="inf_adopted_algorithm_can_undo ()">inf_adopted_algorithm_can_undo</a>      (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-can-redo" title="inf_adopted_algorithm_can_redo ()">inf_adopted_algorithm_can_redo</a>      (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfAdoptedAlgorithm.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----InfAdoptedAlgorithm
</pre>
</div>
<div class="refsect1" title="Properties">
<a name="InfAdoptedAlgorithm.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm--buffer" title='The "buffer" property'>buffer</a>"                   <a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a>*            : Read / Write / Construct Only
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm--buffer-modified-state" title='The "buffer-modified-state" property'>buffer-modified-state</a>"    <a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#InfAdoptedStateVector" title="InfAdoptedStateVector"><span class="type">InfAdoptedStateVector</span></a>*  : Read
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm--current-state" title='The "current-state" property'>current-state</a>"            <a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#InfAdoptedStateVector" title="InfAdoptedStateVector"><span class="type">InfAdoptedStateVector</span></a>*  : Read
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm--max-total-log-size" title='The "max-total-log-size" property'>max-total-log-size</a>"       <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write / Construct Only
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm--user-table" title='The "user-table" property'>user-table</a>"               <a class="link" href="InfUserTable.html" title="InfUserTable"><span class="type">InfUserTable</span></a>*         : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" title="Signals">
<a name="InfAdoptedAlgorithm.signals"></a><h2>Signals</h2>
<pre class="synopsis">
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-apply-request" title='The "apply-request" signal'>apply-request</a>"                                  : Run Last
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-can-redo-changed" title='The "can-redo-changed" signal'>can-redo-changed</a>"                               : Run Last
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-can-undo-changed" title='The "can-undo-changed" signal'>can-undo-changed</a>"                               : Run Last
  "<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-execute-request" title='The "execute-request" signal'>execute-request</a>"                                : Run Last
</pre>
</div>
<div class="refsect1" title="Description">
<a name="InfAdoptedAlgorithm.description"></a><h2>Description</h2>
<p>
<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> implements the adOPTed algorithm for concurrency
control as described in the paper "An integrating, transformation-oriented
approach to concurrency control and undo in group editors" by Matthias
Ressel, Doris Nitsche-Ruhland and Rul Gunzenhäuser
(http://portal.acm.org/citation.cfm?id=240305).
</p>
<p>
It is based on requests, represented by the <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> class. If
there is at least one local <a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> in the algorithm's user table, then
you can create own reequests by the functions
<a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-request" title="inf_adopted_algorithm_generate_request ()"><code class="function">inf_adopted_algorithm_generate_request()</code></a>,
<a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-request-noexec" title="inf_adopted_algorithm_generate_request_noexec ()"><code class="function">inf_adopted_algorithm_generate_request_noexec()</code></a>,
<a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-undo" title="inf_adopted_algorithm_generate_undo ()"><code class="function">inf_adopted_algorithm_generate_undo()</code></a> and
<a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-redo" title="inf_adopted_algorithm_generate_redo ()"><code class="function">inf_adopted_algorithm_generate_redo()</code></a>. Remote requests can be applied via
<a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-receive-request" title="inf_adopted_algorithm_receive_request ()"><code class="function">inf_adopted_algorithm_receive_request()</code></a>. This class does not take care of
transfering the generated requests to other users which is the scope of
<a class="link" href="InfAdoptedSession.html" title="InfAdoptedSession"><span class="type">InfAdoptedSession</span></a>.
</p>
<p>
The implementation is not tied to text editing. It can handle any
operations implementing <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> as long as they define
sufficient transformation functions. The libinftext library provides
operations for text editing, see <a href="../libinftext-0.4/libinftext-0.4-inf-text-operations.html#InfTextInsertOperation"><span class="type">InfTextInsertOperation</span></a> and
<a href="../libinftext-0.4/libinftext-0.4-inf-text-operations.html#InfTextDeleteOperation"><span class="type">InfTextDeleteOperation</span></a>.
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfAdoptedAlgorithm.details"></a><h2>Details</h2>
<div class="refsect2" title="InfAdoptedAlgorithm">
<a name="InfAdoptedAlgorithm-struct"></a><h3>InfAdoptedAlgorithm</h3>
<pre class="programlisting">typedef struct _InfAdoptedAlgorithm InfAdoptedAlgorithm;</pre>
<p>
<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> is an opaque data type. You should only access it via
the public API functions.
</p>
</div>
<hr>
<div class="refsect2" title="InfAdoptedAlgorithmClass">
<a name="InfAdoptedAlgorithmClass"></a><h3>InfAdoptedAlgorithmClass</h3>
<pre class="programlisting">typedef struct {
  void(*can_undo_changed)(InfAdoptedAlgorithm* algorithm,
                          InfAdoptedUser* user,
                          gboolean can_undo);

  void(*can_redo_changed)(InfAdoptedAlgorithm* algorithm,
                          InfAdoptedUser* user,
                          gboolean can_redo);

  void(*execute_request)(InfAdoptedAlgorithm* algorithm,
                         InfAdoptedUser* user,
                         InfAdoptedRequest* request,
                         gboolean apply);

  void(*apply_request)(InfAdoptedAlgorithm* algorithm,
                       InfAdoptedUser* user,
                       InfAdoptedRequest* request);
} InfAdoptedAlgorithmClass;
</pre>
<p>
Signals for the <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> class.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedAlgorithmClass.can-undo-changed"></a>can_undo_changed</code></em> ()</span></p></td>
<td>Default signal handler for the
<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-can-undo-changed" title='The "can-undo-changed" signal'><span class="type">"can_undo_changed"</span></a> signal.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedAlgorithmClass.can-redo-changed"></a>can_redo_changed</code></em> ()</span></p></td>
<td>Default signal handler for the
<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-can-redo-changed" title='The "can-redo-changed" signal'><span class="type">"can_redo_changed"</span></a> signal.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedAlgorithmClass.execute-request"></a>execute_request</code></em> ()</span></p></td>
<td>Default signal handler for the
<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-execute-request" title='The "execute-request" signal'><span class="type">"execute_request"</span></a> signal.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedAlgorithmClass.apply-request"></a>apply_request</code></em> ()</span></p></td>
<td>Default signal handler for the
<a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-apply-request" title='The "apply-request" signal'><span class="type">"apply_request"</span></a> signal.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_new ()">
<a name="inf-adopted-algorithm-new"></a><h3>inf_adopted_algorithm_new ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="returnvalue">InfAdoptedAlgorithm</span></a> * inf_adopted_algorithm_new         (<em class="parameter"><code><a class="link" href="InfUserTable.html" title="InfUserTable"><span class="type">InfUserTable</span></a> *user_table</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>);</pre>
<p>
Creates a <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_table</code></em> :</span></p></td>
<td>The table of participating users.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to apply operations to.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_new_full ()">
<a name="inf-adopted-algorithm-new-full"></a><h3>inf_adopted_algorithm_new_full ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="returnvalue">InfAdoptedAlgorithm</span></a> * inf_adopted_algorithm_new_full    (<em class="parameter"><code><a class="link" href="InfUserTable.html" title="InfUserTable"><span class="type">InfUserTable</span></a> *user_table</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> max_total_log_size</code></em>);</pre>
<p>
Note that it is possible that request logs need to grow a bit larger than
<em class="parameter"><code>max_total_log_size</code></em> in high-latency situations or when a user does not send
status updates frequently. However, when all requests have been
processed by all users, the sum of all requests in the logs is guaranteed
to be lower or equal to this value.
</p>
<p>
Set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Limits-of-Basic-Types.html#G-MAXUINT:CAPS"><code class="literal">G_MAXUINT</code></a> to disable limitation. In theory, this would allow
everyone to undo every operation up to the first one ever made. In practise,
this issues a huge amount of data that needs to be synchronized on user
join and is too expensive to compute anyway.
</p>
<p>
The default value is 2048.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_table</code></em> :</span></p></td>
<td>The table of participating users.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to apply operations to.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_total_log_size</code></em> :</span></p></td>
<td>The maxmimum number of operations to keep in all
user's request logs.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_get_current ()">
<a name="inf-adopted-algorithm-get-current"></a><h3>inf_adopted_algorithm_get_current ()</h3>
<pre class="programlisting"><a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#InfAdoptedStateVector" title="InfAdoptedStateVector"><span class="returnvalue">InfAdoptedStateVector</span></a> * inf_adopted_algorithm_get_current
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_generate_request_noexec ()">
<a name="inf-adopted-algorithm-generate-request-noexec"></a><h3>inf_adopted_algorithm_generate_request_noexec ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * inf_adopted_algorithm_generate_request_noexec
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);</pre>
<p>
Creates a <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> for the given operation, executed by <em class="parameter"><code>user</code></em>.
The user needs to have the <code class="literal">INF_USER_LOCAL</code> flag set.
</p>
<p>
The operation is not applied to the buffer, so you are responsible that
the operation is applied before the next request is processed or generated.
This may be useful if you are applying multiple operations, but want
to only make a single request out of them to save bandwidth.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A local <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> that needs to be transmitted to the
other non-local users.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_generate_request ()">
<a name="inf-adopted-algorithm-generate-request"></a><h3>inf_adopted_algorithm_generate_request ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * inf_adopted_algorithm_generate_request
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);</pre>
<p>
Creates a <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> for the given operation, executed by <em class="parameter"><code>user</code></em>.
The user needs to have the <code class="literal">INF_USER_LOCAL</code> flag set. <em class="parameter"><code>operation</code></em> is
applied to the buffer (by <em class="parameter"><code>user</code></em>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A local <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> that needs to be transmitted to the
other non-local users.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_generate_undo ()">
<a name="inf-adopted-algorithm-generate-undo"></a><h3>inf_adopted_algorithm_generate_undo ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * inf_adopted_algorithm_generate_undo (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>);</pre>
<p>
Creates a request of type <a class="link" href="InfAdoptedRequest.html#INF-ADOPTED-REQUEST-UNDO:CAPS"><code class="literal">INF_ADOPTED_REQUEST_UNDO</code></a> for the given
user and with the current vector time. The user needs to have the
<code class="literal">INF_USER_LOCAL</code> flag set. It also applies the effect of the operation to
the buffer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A local <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> that needs to be transmitted to the
other non-local users.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_generate_redo ()">
<a name="inf-adopted-algorithm-generate-redo"></a><h3>inf_adopted_algorithm_generate_redo ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * inf_adopted_algorithm_generate_redo (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>);</pre>
<p>
Creates a request of type <a class="link" href="InfAdoptedRequest.html#INF-ADOPTED-REQUEST-REDO:CAPS"><code class="literal">INF_ADOPTED_REQUEST_REDO</code></a> for the given
user and with the current vector time. The user needs to have the
<code class="literal">INF_USER_LOCAL</code> flag set. It also applies the effect of the operation to
the buffer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A local <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> that needs to be transmitted to the
other non-local users.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_translate_request ()">
<a name="inf-adopted-algorithm-translate-request"></a><h3>inf_adopted_algorithm_translate_request ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="returnvalue">InfAdoptedRequest</span></a> * inf_adopted_algorithm_translate_request
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> *request</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#InfAdoptedStateVector" title="InfAdoptedStateVector"><span class="type">InfAdoptedStateVector</span></a> *to</code></em>);</pre>
<p>
Translates <em class="parameter"><code>request</code></em> so that it can be applied to the document at state <em class="parameter"><code>to</code></em>.
<em class="parameter"><code>request</code></em> will not be modified but a new, translated request is returned
instead.
</p>
<p>
There are several preconditions for this function to be called. <em class="parameter"><code>to</code></em> must
be a reachable point in the state space. Also, requests can only be
translated in forward direction, so <em class="parameter"><code>request</code></em>'s vector time must be
causally before (see <a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#inf-adopted-state-vector-causally-before" title="inf_adopted_state_vector_causally_before ()"><code class="function">inf_adopted_state_vector_causally_before()</code></a>) <em class="parameter"><code>to</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>to</code></em> :</span></p></td>
<td>The state vector to translate <em class="parameter"><code>request</code></em> to.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new or cached <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a>. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>
when no longer needed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_receive_request ()">
<a name="inf-adopted-algorithm-receive-request"></a><h3>inf_adopted_algorithm_receive_request ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_adopted_algorithm_receive_request
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> *request</code></em>);</pre>
<p>
This function processes a request received from a non-local user and
applies its operation to the buffer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> from a non-local user.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_can_undo ()">
<a name="inf-adopted-algorithm-can-undo"></a><h3>inf_adopted_algorithm_can_undo ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            inf_adopted_algorithm_can_undo      (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>);</pre>
<p>
Returns whether <em class="parameter"><code>user</code></em> can issue an undo request in the current state. Note
that if <em class="parameter"><code>user</code></em> is non-local, then the result of this function does not
depend on the current state but on the state that we know <em class="parameter"><code>user</code></em> is
guaranteed to have reached. This is because <em class="parameter"><code>user</code></em> might still issue an
Undo request even if the max-total-log-size is already exceeded if <em class="parameter"><code>user</code></em>
does not know yet that it is exceeded.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A local <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if Undo is possible, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_algorithm_can_redo ()">
<a name="inf-adopted-algorithm-can-redo"></a><h3>inf_adopted_algorithm_can_redo ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            inf_adopted_algorithm_can_redo      (<em class="parameter"><code><a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *user</code></em>);</pre>
<p>
Returns whether <em class="parameter"><code>user</code></em> can issue a redo request in the current state. Note
that if <em class="parameter"><code>user</code></em> is non-local, then the result of this function does not
depend on the current state but on the state that we know <em class="parameter"><code>user</code></em> is
guaranteed to have reached. This is because <em class="parameter"><code>user</code></em> might still issue a
Redo request even if the max-total-log-size is already exceeded if <em class="parameter"><code>user</code></em>
does not know yet that it is exceeded.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A local <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if Redo is possible, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="InfAdoptedAlgorithm.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "buffer" property'>
<a name="InfAdoptedAlgorithm--buffer"></a><h3>The <code class="literal">"buffer"</code> property</h3>
<pre class="programlisting">  "buffer"                   <a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a>*            : Read / Write / Construct Only</pre>
<p>The buffer to apply operations to.</p>
</div>
<hr>
<div class="refsect2" title='The "buffer-modified-state" property'>
<a name="InfAdoptedAlgorithm--buffer-modified-state"></a><h3>The <code class="literal">"buffer-modified-state"</code> property</h3>
<pre class="programlisting">  "buffer-modified-state"    <a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#InfAdoptedStateVector" title="InfAdoptedStateVector"><span class="type">InfAdoptedStateVector</span></a>*  : Read</pre>
<p>The state in which the buffer is considered not being modified.</p>
</div>
<hr>
<div class="refsect2" title='The "current-state" property'>
<a name="InfAdoptedAlgorithm--current-state"></a><h3>The <code class="literal">"current-state"</code> property</h3>
<pre class="programlisting">  "current-state"            <a class="link" href="libinfinity-0.4-InfAdoptedStateVector.html#InfAdoptedStateVector" title="InfAdoptedStateVector"><span class="type">InfAdoptedStateVector</span></a>*  : Read</pre>
<p>The state vector describing the current document state.</p>
</div>
<hr>
<div class="refsect2" title='The "max-total-log-size" property'>
<a name="InfAdoptedAlgorithm--max-total-log-size"></a><h3>The <code class="literal">"max-total-log-size"</code> property</h3>
<pre class="programlisting">  "max-total-log-size"       <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write / Construct Only</pre>
<p>The maximum number of requests to keep in all user's logs.</p>
<p>Default value: 2048</p>
</div>
<hr>
<div class="refsect2" title='The "user-table" property'>
<a name="InfAdoptedAlgorithm--user-table"></a><h3>The <code class="literal">"user-table"</code> property</h3>
<pre class="programlisting">  "user-table"               <a class="link" href="InfUserTable.html" title="InfUserTable"><span class="type">InfUserTable</span></a>*         : Read / Write / Construct Only</pre>
<p>The user table.</p>
</div>
</div>
<div class="refsect1" title="Signal Details">
<a name="InfAdoptedAlgorithm.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2" title='The "apply-request" signal'>
<a name="InfAdoptedAlgorithm-apply-request"></a><h3>The <code class="literal">"apply-request"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                user_function                      (<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm,
                                                        <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>      *user,
                                                        <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a>   *request,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>             user_data)      : Run Last</pre>
<p>
This signal is emitted every time the algorithm applies a request.
</p>
<p>
Note a call to <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-request" title="inf_adopted_algorithm_generate_request ()"><code class="function">inf_adopted_algorithm_generate_request()</code></a>,
<a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-undo" title="inf_adopted_algorithm_generate_undo ()"><code class="function">inf_adopted_algorithm_generate_undo()</code></a>
or <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-redo" title="inf_adopted_algorithm_generate_redo ()"><code class="function">inf_adopted_algorithm_generate_redo()</code></a> always applies the generated
request. In contrast, <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-receive-request" title="inf_adopted_algorithm_receive_request ()"><code class="function">inf_adopted_algorithm_receive_request()</code></a> might not
apply the given request (if requests it depends upon have not yet
received) or might apply multiple request (if the provided request
fulfills the dependencies of queued requests).
</p>
<p>
Note also that the signal is not emitted for every request processed by
<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> since <code class="function">inf_adopted_algorthm_generate_request_noexec()</code>
generates a request but does not apply it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>The <span class="type">InfAdopedAlgorithm</span> applying a request.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> applying the request.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> being applied.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title='The "can-redo-changed" signal'>
<a name="InfAdoptedAlgorithm-can-redo-changed"></a><h3>The <code class="literal">"can-redo-changed"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                user_function                      (<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm,
                                                        <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>      *user,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>             can_undo,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>             user_data)      : Run Last</pre>
<p>
This signal is emitted every time the can-redo state of a local user
in <em class="parameter"><code>algorithm</code></em>'s user table changed. The can-redo state defines whether
<em class="parameter"><code>user</code></em> can generate a redo request
(via <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-redo" title="inf_adopted_algorithm_generate_redo ()"><code class="function">inf_adopted_algorithm_generate_redo()</code></a>) in the current situation, see
also <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-can-redo" title="inf_adopted_algorithm_can_redo ()"><code class="function">inf_adopted_algorithm_can_redo()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> for which a user's
can-redo state changed.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> whose can-redo state has changed.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>can_undo</code></em> :</span></p></td>
<td>Whether <em class="parameter"><code>user</code></em> can issue a redo request in the current
state or not.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title='The "can-undo-changed" signal'>
<a name="InfAdoptedAlgorithm-can-undo-changed"></a><h3>The <code class="literal">"can-undo-changed"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                user_function                      (<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm,
                                                        <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>      *user,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>             can_undo,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>             user_data)      : Run Last</pre>
<p>
This signal is emitted every time the can-undo state of a local user
in <em class="parameter"><code>algorithm</code></em>'s user table changed. The can-undo state defines whether
<em class="parameter"><code>user</code></em> can generate an undo request
(via <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-generate-undo" title="inf_adopted_algorithm_generate_undo ()"><code class="function">inf_adopted_algorithm_generate_undo()</code></a>) in the current situation, see
also <a class="link" href="InfAdoptedAlgorithm.html#inf-adopted-algorithm-can-undo" title="inf_adopted_algorithm_can_undo ()"><code class="function">inf_adopted_algorithm_can_undo()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> for which a user's
can-undo state changed.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> whose can-undo state has changed.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>can_undo</code></em> :</span></p></td>
<td>Whether <em class="parameter"><code>user</code></em> can issue an undo request in the current
state or not.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title='The "execute-request" signal'>
<a name="InfAdoptedAlgorithm-execute-request"></a><h3>The <code class="literal">"execute-request"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                user_function                      (<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> *algorithm,
                                                        <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>      *user,
                                                        <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a>   *request,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>             apply,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>             user_data)      : Run Last</pre>
<p>
This signal is emitted every time the algorithm executes a request.
<em class="parameter"><code>request</code></em> is the request that <em class="parameter"><code>algorithm</code></em> will execute. <em class="parameter"><code>request</code></em> can
generally not be applied to the current state, and it might also be an
undo or redo request. The default handler of this signal computes the
operation that can be applied to the buffer, and applies it when <em class="parameter"><code>apply</code></em>
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> by emitting <a class="link" href="InfAdoptedAlgorithm.html#InfAdoptedAlgorithm-apply-request" title='The "apply-request" signal'><span class="type">"apply-request"</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>algorithm</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a> executing a request.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> executing the request.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a> being executed.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>apply</code></em> :</span></p></td>
<td>Whether the request will be applied after execution.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="InfAdoptedAlgorithm.see-also"></a><h2>See Also</h2>
<a class="link" href="InfAdoptedSession.html" title="InfAdoptedSession"><span class="type">InfAdoptedSession</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>